package com.gdpa.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.gdpa.entity.BrokerBuildingWithAreaName;
import com.gdpa.entity.BrokerHouse;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gdpa.entity.BrokerHouseWithName;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 经纪房源表 Mapper 接口
 * </p>
 *
 * @author zsr
 * @since 2018-12-19
 */
public interface BrokerHouseMapper extends BaseMapper<BrokerHouse> {
    //获取房源的所有信息
    List<BrokerHouse> getHouse(Page page);

    //根据ID删除房源
    boolean deleteById(@Param("id") Integer id);

    //添加房源
    boolean add(BrokerHouseWithName brokerHouseWithName);

    //修改房源
    boolean update(BrokerHouseWithName brokerHouseWithName);

    //查询房源
    List<BrokerHouseWithName> find(Page page,@Param("id") Integer id,@Param("price")Integer price,@Param("state")Integer state);

    //根据楼盘ID获取楼盘名称
    String getBuildingName(@Param("id") Integer id);

    //根据用户ID查询用户名
    String getUserName(@Param("id") Integer id);
}
